package com.wimcorp.magic.abilities.trigger;

import javax.persistence.Entity;

import com.wimcorp.magic.abilities.Ability;
import com.wimcorp.magic.cards.Creature;
import com.wimcorp.magic.cards.PlayingCard;

@Entity
public class OnCreatureDeath extends AbilityTrigger {
	public OnCreatureDeath() {
	}

	public OnCreatureDeath(Ability ability){
		super(ability);
	}

	public OnCreatureDeath(OnCreatureDeath abilityTrigger) {
		super(abilityTrigger);
	}
	
	@Override
	public void register() {
		((Creature)getAbility().getCard()).registerDeathListener(getAbility());
		
	}
	
	@Override
	public void unRegister() {
		((Creature)getAbility().getCard()).unRegisterDeathListener(getAbility());
		
	}
	
	public OnCreatureDeath clone() {
		return new OnCreatureDeath(this);
	}
}
